<script setup lang="ts">
import { ElDropdown, ElDropdownMenu, ElDropdownItem } from "element-plus";
import { useUserStore } from "@/store/modules/user";
const userStore = useUserStore();
// 退出登录
const logout = () => {
  userStore.logout()
  // location.reload();
};
</script>

<template>
  <el-dropdown trigger="click" style="cursor: pointer">
    <div style="display: flex; align-items: center">
      <img
        style="height: calc(var(--logo-height) - 25px)"
        src="@/assets/logo/trans_bg.png"
        class="avatar"
      />
      <span style="padding: 0 5px; font-size: 17px"> admin </span>
    </div>
    <template #dropdown>
      <el-dropdown-menu>
        <el-dropdown-item @click="logout">退出登录</el-dropdown-item>
      </el-dropdown-menu>
    </template>
  </el-dropdown>
</template>
<style scoped lang="less"></style>
